package com.ai.wx.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ai.core.constant.GlobalConstant;
import com.ai.core.dao.BaseDaoI;
import com.ai.wx.entity.MobileMap;
import com.ai.wx.service.MobileMapService;

@Service
public class MobileMapServiceImpl implements MobileMapService {
	@Autowired
	private BaseDaoI<MobileMap> mobileMapDao;

	public MobileMap getMobileMap(String mobileNumber) {
		MobileMap mobileMap = mobileMapDao.get(MobileMap.class, mobileNumber);
		return mobileMap;
	}

	@Override
	public boolean isSHCmccMobile(String mobileNumber) {
		MobileMap mobileMap = getMobileMap(mobileNumber);
		if (mobileMap != null && mobileMap.getAreaCode().intValue() == 21 && mobileMap.getMobileType().intValue() == GlobalConstant.OPER_ID_CMCC.intValue())
			return true;
		else
			return false;
	}

}
